package com.teacold.customdemo.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.teacold.customdemo.R;

public class TFZHLayout extends LinearLayout {
    public TFLongClickListener mLongClickListener;

    public void setTFLongClickListener(TFLongClickListener listener) {
        this.mLongClickListener = listener;
    }

    //提供遮罩中按钮点击操作接口  自定义
    public interface TFLongClickListener {
        void deleteZH();
    }
    public TFZHLayout(Context context) {
        this(context,null);
    }

    public TFZHLayout(Context context,AttributeSet attrs) {
        this(context, attrs,0);
    }

    public TFZHLayout(Context context,  AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        LayoutInflater.from(context).inflate(R.layout.tf_switchmask_item,this,true);
        findViewById(R.id.mask_delete).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mLongClickListener != null) {
                    mLongClickListener.deleteZH();
                }
            }
        });

    }






}
